{-# LANGUAGE DeriveDataTypeable, TypeFamilies, TemplateHaskell #-}

module Haircut (
        Haircut, -- CONSTRUCTOR: MkHaircut HaircutName HaircutDescription
        createHaircut, -- createHaircut :: HaircutName -> HaircutDescription -> Haircut
        getHaircutName, -- getHaircutName :: Haircut -> HaircutName
        getHaircutDesc, -- getHaircutDesc :: Haircut -> HaircutDescription
) where


import Data.Acid

import Control.Monad.State
import Control.Monad.Reader
import System.Environment
import Data.SafeCopy

import Data.Typeable


{-
AUTOR:Gaston Charkiewicz
DESCRIPCION: estructura de datos que representa un corte de pelo simple, con una descripcion. 
OBSERVACIONES:Notese que NO REPRESENTA un corte hecho en una ocasion especifica a algun cliente.
-}

data Haircut = MkHaircut HaircutName HaircutDescription
    deriving (Show, Typeable)
type HaircutName = String
type HaircutDescription = String
-- le digo que sea "persistible"
$(deriveSafeCopy 0 'base ''Haircut)

createHaircut :: HaircutName -> HaircutDescription -> Haircut
createHaircut name description = MkHaircut name description  

-- No devuelvo el tipo verdadero porque no corresponde que devuelta un string por conveniencia,
-- para esas cosas esta el controlador
getHaircutName :: Haircut -> HaircutName
getHaircutName (MkHaircut hisName hisDesc) = hisName

getHaircutDesc :: Haircut -> HaircutDescription
getHaircutDesc (MkHaircut hisName hisDesc) = hisDesc



------------------------------------------------------

